<?php if($_GET['ext']=='manga'){
                    	 if($_SESSION['mobile']==0){ echo '<ul class="breadcrumb">' ;}else{ echo '<ul class="breadcrumb">';}?>
                       <li><a href="<?php echo HOME; ?>"><i class="fa fa-home"></i></a></li>
                        <li><a href="<?php echo HOME ?>history/manga">Danh sách Manga đang theo dõi</a></li> 
					    </ul>
       <?php
		if(isset($_SESSION['user'])){
		require("public/exts/xcrud/xcrud.php");				
		$xcrud = Xcrud::get_instance();
        $xcrud->table('truyen_history');
		$xcrud->where('username',$_SESSION['user']['username']);
		$xcrud->relation('truyen_id','anime','id','name'); // Check xem user dang ky upload truyen nao
		//    $xcrud->relation('truyen_chuong_id','truyen_chuong','id','ten'); // Check xem user dang ky upload truyen nao
		
 
		$xcrud->column_cut(350,'url');
	
		
		$xcrud->subselect('latest','SELECT ep_moinhat FROM anime WHERE id = {truyen_id}'); // insert as last column	
		$xcrud->columns('truyen_id,url,ten,ngay,latest');
		$xcrud->label(array('truyen_id'=>'Manga','url'=>'Link','ten'=>'Chapter Đánh Dấu','ngay'=>'Ngày','latest'=>'Mới Nhất'));
		
		$xcrud->column_callback('url','manga_history');
		$xcrud->column_pattern('url','<a href="{url}" target="_blank">Xem Chi Tiết</a>');
		
		$xcrud->unset_view();
		$xcrud->unset_add();
		$xcrud->unset_edit();
		$xcrud->unset_csv();
		
		$xcrud->unset_print();
		$xcrud->unset_title();
		echo $xcrud->render();
		?>
 <style>
fb_iframe_widget,
.fb_iframe_widget > span,
.fb_iframe_widget iframe {
    width: 100% !important;
}
    .glyphicon-ok.state01-1,.glyphicon-remove.state01-0{
    display:none;
	}
	.state01-0{ color: #0C6}
	.state01-1{ color: #F00}
	.glyphicon-ok.state10-0,.glyphicon-remove.state10-1{
    display:none;
	}
	.state10-1{ color:#0C6 }
	.state10-0{ color: #F00}
	</style>
    <?php }else{?>
    
    <div class="alert alert-warning">Hãy Đăng Nhập để xem danh dách manga đang theo dõi của bạn nhé</div>
    <?php }?>
<div class="clearfix"></div>
</div>
</div><!-- end wrapMain -->
<?php }?>